package com.eastfair.notice.dto;

import com.eastfair.annotation.base.LanguageTypeEnum;
import com.eastfair.annotation.base.SubjectTypeEnum;
import com.eastfair.enums.NoticeTypeEnum;
import lombok.*;

import java.util.List;

/**
 * @ClassName MsgDTO
 * @Description 发送消息
 * @Author liuxiaobai
 * @Date 2021/8/5 9:57 上午
 * @Version 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class MsgSendDTO {
    /**
     * 项目ID
     */
    private Long projectId;
    /**
     * 展会ID
     */
    private Long exhibitionId;
    /**
     * 消息类型集合 类型-模板
     */
    private List<MsgSendTypeDTO> sendTypes;
    /**
     * 接收人email
     */
    private String email;
    /**
     * 接收人手机号
     */
    private String mobile;
    /**
     * 接收人user_account_id
     */
    private Long receiveUserId;
    /**
     * 替换KV集合
     */
    private List<MsgFieldDTO> fields;

    private Object field;
    /**
     * 签名
     */
    private String sign;
    /**
     * 语言
     * LanguageTypeEnum
     */
    private LanguageTypeEnum languageType;
    /**
     * 是否为验证码
     */
    private Boolean isCode;
    //站内信//
    /**
     * 站内信类型
     */
    private NoticeTypeEnum noticeType;
    /**
     * 接收人类型 SubjectTypeEnum EMPLOYEE、VISITOR
     */
    private SubjectTypeEnum receiveType;
    /**
     * 业务类型
     */
    private SubjectTypeEnum subjectType;
    /**
     * 业务ID
     */
    private Long businessId;

    /**
     * 参数校验
     *
     * @return 校验不通过-true
     */
    public boolean unCheck() {
        return receiveUserId == null
                || sendTypes == null
                || sendTypes.isEmpty();
    }
}
